<?php

use think\migration\Migrator;
use think\migration\db\Column;

class Wishs extends Migrator
{
    public function up()
    {
        $table = $this->table('wishs');
        $table->addColumn('user_id', 'integer', array('comment' => '发布心愿会员id'))
              ->addColumn('start_date', 'date', array('comment' => '心愿开始日期'))
              ->addColumn('end_date', 'date', array('comment' => '心愿结束日期'))
              ->addColumn('region', 'string', array('limit' => 30, 'comment' => '营地所属地区'))
              ->addColumn('travel_coin', 'integer', array('default' => 0, 'comment' => '悬赏的旅行币'))
              ->addColumn('complete_caravan_id', 'integer', array('default' => 0, 'limit' => 5, 'comment' => '完成心愿的房车id'))
              ->addColumn('types', 'integer', array('default' => 1, 'limit' => 1, 'comment' => '类型'))
              ->addColumn('created_at', 'timestamp', array('default' => 'CURRENT_TIMESTAMP'))
              ->addColumn('updated_at', 'timestamp', array('null' => true))
              ->save();   
    }
    public function down()
    {
        $this->dropTable('wishs');
    }
}
